from __init__ import *
from hashlib import md5



@fetch
def register_test() -> Response:
    return requests.post(
        url=Apis.account_register,
        json={
            "email": "231499859@qq.com",
            "password": "Yang060312456",
            "nickName": "WoodenEasy",
            "avatar": "222",
            "introduction": "43",
        },
        headers= {
            "captcha-key": "095d7a29-2acf-4c9d-9adb-a7c9ec956181",
            "captcha-answer": "[0,2,3]"
        }
    )


@fetch
def login_test() -> Response:
    return requests.post(
        url=Apis.account_login,
        json={
            "email": "231499859@qq.com",
            "password": "8eb20959b16e5de0a8bf6a5d01f9f81c"
        },
        headers= {
            "captcha-key": "bd7561d8-5829-4ee5-a1bf-d74097c87a36",
            "captcha-answer": "[1,2,3]"
        }
    )


@fetch
def get_public_key() -> Response:
    return requests.get(
        url=Apis.account_get_public_key
    )


if __name__ == "__main__":
    pprint(login_test())
    #  pprint(register_test())
